﻿using System.Collections.Generic;
using com.guojin.core.io;
using com.guojin.core.io.message;
using com.guojin.mj.net.message.game;

namespace com.guojin.mj.net.message.game
{
    public class SitDownRet: Message
    {
        public static int TYPE = 12 ;
        public static int ID =  32 ;

        public int SitDownType { get; set; } //0离坐  1坐下
        public int userId { get; set; } //玩家ID
        public int locationIndex { get; set; } //玩家的
        public GameRoomInfoRet  gri{ get; set; } //观战玩家坐下需要位置变换，重新获取房间信息

        public void decode(Input _in)
        {
            SitDownType = _in.readInt();
            userId = _in.readInt();
            locationIndex = _in.readInt();
            gri = new GameRoomInfoRet();
            gri.decode(_in);
        }

        public void encode(Output _out)
        {
        }

        public int getMessageId()
        {
            return ID;
        }

        public int getMessageType()
        {
            return TYPE;
        }

        public string toString()
        {
            return string.Format("SitDownType={0}, CreateUserId= {1}, locationIndex={2}",SitDownType,userId,locationIndex);
        }
    }
}